﻿using SalesSys.Comm.BLL;
using SalesSys.Comm.DAL;
using SalesSys.DAL.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SalesSys.BLL
{
    public class DistrictBLL : BaseBLL<District, Guid>
    {
        protected IRepository<District> _DistrictRep;
        protected virtual IRepository<District> DistrictRep
        {
            get { return _DistrictRep ?? (_DistrictRep = RepositoryFactory.GetRepositoryByFactoryUnit<IRepository<District>>()); }
            set { _DistrictRep = value; }
        }
        public District GetDistrict(Guid id)
        {
            return DistrictRep.Find(id);
        }
        public IEnumerable<District> GetDistricts()
        {
            return DistrictRep.Entities.Where(p => p.Lv == 1).ToList();
        } 

    }
}
